;-----------------------------------------------------------;
(import-class "java.io.File")

;-----------------------------------------------------------;
(import-class "java.io.InputStream")

;-----------------------------------------------------------;
(import-class "java.io.OutputStream")

;-----------------------------------------------------------;
(import-class "java.io.FileInputStream")

;-----------------------------------------------------------;
(import-class "java.io.InputStreamReader")

;-----------------------------------------------------------;
(import-class "java.io.BufferedReader")

;-----------------------------------------------------------;
(import-class "java.io.PrintStream")

;-----------------------------------------------------------;
; Utility
;-----------------------------------------------------------;

(defun open-reader (name)
  (new-java.io.BufferedReader
   (new-java.io.InputStreamReader
    (new-java.io.FileInputStream name))))

(defun readline (f)
  (java.io.bufferedreader.readLine f))

(defun cat (name)
  (let (l (f (open-reader name)))
    (setq l (readline f))
    (while l
      (println l)
      (setq l (readline f)))))

(defun dir-list (dirname)
  (array-to-list
   (java.io.file.list (new-java.io.file dirname))))
